package cn.edu.sgu.www.mhxysy.service.achievement.impl;

import cn.edu.sgu.www.mhxysy.entity.achievement.ChengweiType;
import cn.edu.sgu.www.mhxysy.mapper.achievement.ChengweiTypeMapper;
import cn.edu.sgu.www.mhxysy.service.achievement.ChengweiTypeService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Service
public class ChengweiTypeServiceImpl implements ChengweiTypeService {

    private final ChengweiTypeMapper chengweiTypeMapper;

    @Autowired
    public ChengweiTypeServiceImpl(ChengweiTypeMapper chengweiTypeMapper) {
        this.chengweiTypeMapper = chengweiTypeMapper;
    }

    @Override
    public ChengweiType selectById(Integer id) {
        return chengweiTypeMapper.selectById(id);
    }

    @Override
    public List<ChengweiType> selectByType(Integer type) {
        QueryWrapper<ChengweiType> queryWrapper = new QueryWrapper<>();

        queryWrapper.eq("type", type);

        return chengweiTypeMapper.selectList(queryWrapper);
    }

}